-
Notifications
You must be signed in to change notification settings - Fork 27
Fetch our own stars! #28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
I'm lumping in some unrelated code formatting, I think `en.json` was updated by the build somehow to remove unused keys? The rest is probably VS Code. Happy to revert formatting to be just the stars.
This pull request is automatically deployed with Now. To access deployments, click Details below or on the icon next to each push. |
Oh BTW no styling, maybe later? |
Closes #24 |
Looks like I didn't break anything obvious hehe |
Now cannot deploy because all the allocated instances are in use. |
Now cannot deploy because all the allocated instances are in use. |
return ( | ||
<div> | ||
<a href="https://github.com/isomorphic-git/isomorphic-git">GitHub <span id="gitHubStars" /></a> | ||
<script dangerouslySetInnerHTML={{ __html: script }} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hahaha this is so not the "right" way to populate a React component, but I love it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm actually not sure if I understand this right, I just wasn't getting any invocations on componentDidMount
and I figured Docusaurus just runs the server method of the rendering pipeline and stores the serialized result in static files. I've documented this in the comment but if this is not accurate I'd love to fix it up because this is dirty - but let dirty than having the script in the HTML template I think because at least it's collocated with what it mutates. :-D
Now cannot deploy because all the allocated instances are in use. |
website/core/GitHubStarButton.js
Outdated
headers: { accept: 'application/vnd.github.v3+json' } | ||
}) | ||
const data = await response.json() | ||
document.querySelector('#gitHubStars').textContent = '(' + data.stargazers_count + ' stars)' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe ⭐ emoji instead of the word "stars"?
Now cannot deploy because all the allocated instances are in use. |
I like it! Merge it whenever you feel likeit. |
I'm lumping in some unrelated code formatting, I think
en.json
was updated by the build somehow to remove unused keys? The rest is probably VS Code. Happy to revert formatting to be just the stars.